--黯光歧路
local anguangqilu = fk.CreateSkill {
    name = "mcdh_anguangqilu",
}

local U = require "packages/utility/utility"
local lib = require "packages/mcdh/lib"

anguangqilu:addEffect('active',{
    can_use = function(self, player)
        return player:getMark("mcdh_ammo") >= 2
    end,
    target_num = 1,
    card_filter = function(self,player, to_select, selected)
        return #selected == 0 and Fk:getCardById(to_select).type == Card.TypeBasic and not player:prohibitDiscard(Fk:getCardById(to_select))
    end,
    target_filter = function(self,player, to_select, selected)
        local target = to_select
        return #selected == 0 and to_select ~= player and #target:getCardIds("e") ~= 0
    end,
    on_use = function(self, room, effect)
        local player = effect.from
        local target = effect.tos[1]
        lib.LoseAmmo(player,player,2,self.name)
        room:throwCard(effect.cards, self.name, player, player)
        local clonetb = table.clone(target.player_cards[Player.Equip])
        room:moveCards({
            ids = clonetb,
            from = target.id,
            fromArea = Card.PlayerEquip,
            to = target.id,
            toArea = Card.PlayerHand,
            moveReason = fk.ReasonPrey,
            proposer = target.id,
            skillName = self.name,
        })
        player:drawCards(math.min(5, target:getHandcardNum()) - player:getHandcardNum(), self.name)
    end,
})


Fk:loadTranslationTable {
    ["mcdh_anguangqilu"] = "黯光歧路",
    [":mcdh_anguangqilu"] = "装填技(2)，出牌阶段，你可以弃置一张基本牌，令一名角色获得其装备区内的所有牌，然后将手牌摸至与其相同(至多摸至五张)。",
}

return anguangqilu